-
Notifications
You must be signed in to change notification settings - Fork 0
feat: #5 add user data schema and FTS triggers #46
Merged
+793
−20
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rachelks
reviewed
Oct 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall! Just noticed a couple of things:
- The
album_artisttrigger seems to only update the new album when an artist is moved from one album to another. Wouldn't we also need to update the old album's search vector so it doesn't still show up in searches for that artist? - With the new database relationships, running the seed script could also delete existing reviews and crate items because of
TRUNCATE ... CASCADE. Probably not a big issue for our project, but maybe worth documenting that seeding is only intended for development/resetting the database?
I also saw your note about running migrations during deployment, so that should not be a problem for this issue. We will follow it up in #45 :)
rachelks
approved these changes
Oct 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now, thanks for fixing the trigger and documenting the seed behavior! :)
erikhfj
added a commit
that referenced
this pull request
Oct 15, 2026
README was still describing M1, and one line was simply wrong: it said `client/` renders mock data. The mock-data search interface never landed, the client is still the skeleton and #9 wires it straight to GraphQL. - Current milestone moved to M2 - New "Where the code is" table, implemented vs. planned - Local setup for `server/` too: DATABASE_URL, migrate, optional seed - Server commands in the command table - Infrastructure names `crate-api.service` and what CI deploys - M1 row now lists what M1 actually delivered, not mock data that did not land - Sort modes corrected to four, checked against `AlbumSort` in the schema AI usage log gets the eight erikhfj rows missing since 1 October: the #10 identity contract, the #8 VM runbook and the git clone, the #13 facet trade-off, the #43 source-map-js override, the #44 deploy gap, the displayName correction, the #45 review fixes, and this pass. The displayName row is the kind the log intro calls out as most important: the tool drafted a claim that a person had to correct. Per #48 each member documents their own usage, so only erikhfj rows were added. robertky's row from #46 was out of date order at the end of the table and is now with the rest of 9 October, and his relative order within the day is unchanged. Co-Authored-By: opencode <noreply@opencode.ai>
erikhfj
added a commit
that referenced
this pull request
Oct 15, 2026
#46 merged while this was open, so two README claims were behind. The "Implemented" list now names the schema that actually exists: tracks, simulated users, reviews and crate items, with trigger-maintained full-text search over titles at weight A and artist names at weight B. Checked against set_album_search_vector() in migration 0001 rather than the PR description. Also warns that db:seed is a reset command, not a loader. It replaces the catalog and, through foreign-key cascades, deletes the reviews and crate items hanging off it. docs/VM-setup.md gained that warning from #46 and the README was quietly understating it. Not changed: "searchAlbums is the only query with a resolver" is still true after #46, which was schema only and added no resolvers. Co-Authored-By: opencode <noreply@opencode.ai>
erikhfj
added a commit
that referenced
this pull request
Oct 15, 2026
#46 landed migration 0001 for tracks, simulated users, reviews and crate items, and pointed out that this deploy never runs db:migrate. It was right. A deploy that lands new migration files and does not apply them is the same gap as #44 one layer down: the code is current, the schema is not. Migrate runs before the restart, so the new build is never pointed at an old database. It runs on every deploy because db:migrate is idempotent (verified on #46), not only when the migration list changes. DATABASE_URL is exported from the same .env the systemd unit loads. The server package scripts look for `server/.env` instead, which may not exist in the deploy root, so it is passed explicitly rather than assuming the two agree. Node's --env-file does not override a variable already in the environment, so this wins even when server/.env is present. Verified that a URL-encoded password survives the sed extraction and the handoff to the child process byte for byte. Also rebased onto main, which brings #46 along. Co-Authored-By: opencode <noreply@opencode.ai>
erikhfj
added a commit
that referenced
this pull request
Oct 15, 2026
8 tasks
Sign in
to join this conversation on GitHub.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #5
What changed
Verified locally
Deployment follow-up
The VM deployment needs to run the server db:migrate command before restarting the API when this PR is merged. #45 currently builds and restarts the server but does not apply database migrations.